<template>
  <el-card>
    <template #header>
      <h3>订单统计</h3>
    </template>

    <div>
      <!-- 1.0 搜索内容表单 -->
      <el-form
        :inline="true"
        :model="searchForm"
        class="demo-form-inline"
        size="mini"
      >
        <el-form-item label="审批人">
          <el-date-picker
            v-model="searchForm.date"
            type="datetimerange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>

      <!-- 2.0 展示图表 -->
      <Orders :CardName="'orderBox'" @updatePage="SyncRender" />
    </div>
  </el-card>
</template>

<script>
import Orders from '@/components/Charts/Index.vue'
import OrderOp from './js/orderData.js'

export default {
  components: {
    Orders
  },
  data() {
    return {
      searchForm: {
        date: []
      },
      OrderOp,
      chartObj: {}
    }
  },
  mounted() {
    this.chartObj.setOption(this.OrderOp.option)
  },
  methods: {
    onSubmit() {},
    SyncRender(obj) {
      // console.log(obj)
      this.chartObj = obj
    }
  }
}
</script>

<style lang="less" scoped>
.el-form {
  margin-bottom: 30px;
}
</style>
